﻿@model PagedList.IPagedList<EventPlanner.Models.Evento>

@{
    ViewBag.Title = "Mis Eventos";
}
 <div class="subtitle">
<h2>@EventPlanner.Resources.Global.Global.lbl_MisEventos</h2>
</div>
<p></p>
<p>
    @EventPlanner.Resources.Evento.Evento.lbl_Ayuda
</p>
@Html.Partial("_Busqueda_Eventos")          
<table>
    <tr>
        <th>
          @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Nombre, "EventosParticipante", new { sortOrder = ViewBag.NameSortParm }) @Html.Raw((string)ViewBag.NameAddOn)
        </th>
        <th>
             @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Fecha, "EventosParticipante", new { sortOrder = ViewBag.DateSortParm }) @Html.Raw((string)ViewBag.DateAddOn)
        </th>
        <th>
            @EventPlanner.Resources.Global.Global.lbl_Hora
        </th>

        <th>
            @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Lugar, "EventosParticipante", new { sortOrder = ViewBag.LugarSortParm }) @Html.Raw((string)ViewBag.LugarAddOn)
        </th>
        
        <th>
            @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Organizador, "EventosParticipante", new { sortOrder = ViewBag.OrgSortParm }) @Html.Raw((string)ViewBag.OrgeAddOn)
        </th>
        <th>
            @EventPlanner.Resources.Global.Global.lbl_Confirmado
        </th>
        <th></th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Nombre)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Fecha)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Hora)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Lugar)
        </td>
        
        <td>
            @Html.DisplayFor(modelItem => item.Organizador.Nombre)
        </td>
        <td>
            @{
    EventPlanner.Models.Participante p = item.GetParticipantePorUsuario(User.Identity.Name);
    if (p.Confirmado)
    {
                    @Html.Raw(@EventPlanner.Resources.Global.Global.lbl_Si)
    }
    else
    {
                    @Html.Raw(@EventPlanner.Resources.Global.Global.lbl_No)
    }
            }
        </td>
        <td>
            @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Detalles, "DetailsTodos", new { id = item.id })
        </td>
    </tr>
}

</table>
<p></p>

@Html.Partial("_Navegacion_Eventos",Model)